// This file was procedurally generated from the following sources:
// - src/assignment-target-type/optionalexpression.case
// - src/assignment-target-type/invalid/direct.template
/*---
description: Static Semantics AssignmentTargetType, Return invalid. (Direct assignment)
features: [optional-chaining]
flags: [generated]
negative:
  phase: parse
  type: SyntaxError
info: |
    Direct assignment

    OptionalExpression
    Static Semantics AssignmentTargetType, Return invalid.

---*/

function Test() {
    $DONOTEVALUATE();

    x?.y = 1;
}

// preheat
const NUMBER_OF_PREHEAT = 1;
for (let i = 0; i < NUMBER_OF_PREHEAT; i++) {
    Test();
}

ArkTools.jitCompileAsync(Test);
assert.sameValue(ArkTools.waitJitCompileFinish(Test), true, '[JIT] JIT disabled.');

// test
const NUMBER_OF_TEST = 1; // or 2
for (let i = 0; i < NUMBER_OF_TEST; i++) {
    Test();
}
